package com.bootdo.coach.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.coach.dao.TabUserMapper;
import com.bootdo.coach.dao.ext.ExtTabUserMapper;
import com.bootdo.coach.domain.TabUser;
import com.bootdo.coach.service.TabUserService;
import com.bootdo.coach.vo.TabUserVo;


@Service
public class TabUserServiceImpl implements TabUserService {
    @Autowired
    private TabUserMapper mapper;
    @Autowired
    private ExtTabUserMapper extMapper;
    
    @Override
    public TabUser findByDeviceId(Long deviceId) {
    	return extMapper.findByDeviceId(deviceId);
    }

	@Override
	public List<TabUserVo> list(Map<String, Object> params) {
		return extMapper.list(params);
	}

	@Override
	public int count(Map<String, Object> params) {
		return extMapper.count(params);
	}

	@Override
	public TabUser selectByPrimaryKey(Long id) {
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public int insertSelective(TabUser record) {
		return mapper.insertSelective(record);
	}

	@Override
	public List<TabUser> selectByAccount(String account) {
		return extMapper.selectByAccount(account);
	}

	@Override
	public int updateByPrimaryKeySelective(TabUser record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByPrimaryKey(Long id) {
		return mapper.deleteByPrimaryKey(id);
	}

	@Override
	public boolean exitAccount(Map<String, Object> params) {
		boolean exit;
        exit = count(params) > 0;
        return exit;
	}
	
	@Override
	public List<Long> findUserIdList(Long deviceTypeId) {
		
		return extMapper.findUserIdList(deviceTypeId);
	}
}
